/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import controller.OutlookControl;

/**
 *
 * @author ian
 */
public class OutlookView extends javax.swing.JFrame {

    /**
     * Creates new form OutlookView
     */
    
    public OutlookView() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        ReturnButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        TablaTendenciaCentral = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        TablaDispercion = new javax.swing.JTable();
        jRadioMedia = new javax.swing.JRadioButton();
        jRadioMediana = new javax.swing.JRadioButton();
        jRadioModa = new javax.swing.JRadioButton();
        jRadioVarianza = new javax.swing.JRadioButton();
        jRadioDE = new javax.swing.JRadioButton();
        jRadioRI = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        ReturnButton.setText("Volver");
        ReturnButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnButtonActionPerformed(evt);
            }
        });

        TablaTendenciaCentral.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null}
            },
            new String [] {
                "Temperatura", "Presion Atmosferica", "Pluviosidad"
            }
        ));
        jScrollPane2.setViewportView(TablaTendenciaCentral);

        TablaDispercion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null}
            },
            new String [] {
                "Temperatura", "Presion Atmosferica", "Pluviosidad"
            }
        ));
        jScrollPane3.setViewportView(TablaDispercion);

        buttonGroup1.add(jRadioMedia);
        jRadioMedia.setText("Media");
        jRadioMedia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioMediaActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioMediana);
        jRadioMediana.setText("Mediana");
        jRadioMediana.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioMedianaActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioModa);
        jRadioModa.setText("Moda");
        jRadioModa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioModaActionPerformed(evt);
            }
        });

        buttonGroup2.add(jRadioVarianza);
        jRadioVarianza.setText("Varianza");
        jRadioVarianza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioVarianzaActionPerformed(evt);
            }
        });

        buttonGroup2.add(jRadioDE);
        jRadioDE.setText("Desviacion Estándar");
        jRadioDE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioDEActionPerformed(evt);
            }
        });

        buttonGroup2.add(jRadioRI);
        jRadioRI.setText("Rango Intercuartilico");
        jRadioRI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioRIActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("URW Bookman L", 3, 15)); // NOI18N
        jLabel2.setForeground(java.awt.Color.blue);
        jLabel2.setText("Central meteorológica AguasCalientes");

        jLabel1.setFont(new java.awt.Font("URW Bookman L", 3, 15)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 0, 255));
        jLabel1.setText("Reporte estadístico");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(95, 95, 95)
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jRadioVarianza)
                                .addGap(18, 18, 18)
                                .addComponent(jRadioDE)
                                .addGap(18, 18, 18)
                                .addComponent(jRadioRI))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jRadioMedia)
                                .addGap(18, 18, 18)
                                .addComponent(jRadioMediana)
                                .addGap(18, 18, 18)
                                .addComponent(jRadioModa))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 441, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 441, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(ReturnButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(168, 168, 168))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addGap(30, 30, 30)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioMedia)
                    .addComponent(jRadioMediana)
                    .addComponent(jRadioModa))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioVarianza)
                    .addComponent(jRadioDE)
                    .addComponent(jRadioRI))
                .addGap(33, 33, 33)
                .addComponent(ReturnButton)
                .addContainerGap(29, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ReturnButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnButtonActionPerformed
        // TODO add your handling code here:
        CentralFrame newCentralFrame = new CentralFrame();
        newCentralFrame.setLocationRelativeTo(this);
        newCentralFrame.setVisible(true);
        this.dispose(); 
    }//GEN-LAST:event_ReturnButtonActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioMediaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioMediaActionPerformed
        // TODO add your handling code here:
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getTemperatureMedia(), 0, 0);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPresionMedia(), 0, 1);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPluviosityMedia(), 0, 2);
    }//GEN-LAST:event_jRadioMediaActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioMedianaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioMedianaActionPerformed
        // TODO add your handling code here:
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getTemperatureMediana(), 0, 0);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPresionMediana(), 0, 1);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPluviosityMediana(), 0, 2);
    }//GEN-LAST:event_jRadioMedianaActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioModaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioModaActionPerformed
        // TODO add your handling code here:
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getTemperatureModa(), 0, 0);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPresionModa(), 0, 1);
        TablaTendenciaCentral.setValueAt(OutlookControl.getInstance().getPluviosityModa(), 0, 2);
    }//GEN-LAST:event_jRadioModaActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioVarianzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioVarianzaActionPerformed
        // TODO add your handling code here:
        TablaDispercion.setValueAt(OutlookControl.getInstance().getTemperatureVarianza(), 0, 0);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPresionVarianza(), 0, 1);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPluviosityVarianza(), 0, 2);
    }//GEN-LAST:event_jRadioVarianzaActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioDEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioDEActionPerformed
        // TODO add your handling code here:
        TablaDispercion.setValueAt(OutlookControl.getInstance().getTemperatureDE(), 0, 0);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPresionDE(), 0, 1);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPluviosityDE(), 0, 2);
    }//GEN-LAST:event_jRadioDEActionPerformed

    @SuppressWarnings("static-access")
    private void jRadioRIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioRIActionPerformed
        // TODO add your handling code here:
        TablaDispercion.setValueAt(OutlookControl.getInstance().getTemperatureRI(), 0, 0);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPresionRI(), 0, 1);
        TablaDispercion.setValueAt(OutlookControl.getInstance().getPluviosityRI(), 0, 2);
    }//GEN-LAST:event_jRadioRIActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(OutlookView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(OutlookView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(OutlookView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(OutlookView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new OutlookView().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ReturnButton;
    private javax.swing.JTable TablaDispercion;
    private javax.swing.JTable TablaTendenciaCentral;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JRadioButton jRadioDE;
    private javax.swing.JRadioButton jRadioMedia;
    private javax.swing.JRadioButton jRadioMediana;
    private javax.swing.JRadioButton jRadioModa;
    private javax.swing.JRadioButton jRadioRI;
    private javax.swing.JRadioButton jRadioVarianza;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    // End of variables declaration//GEN-END:variables
}
